﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" id="viewport">
		<title>登录-迅泊达</title>
		<link rel="shortcut icon" href="favicon.ico"/>
		<link rel="stylesheet" href="css/login.css" />
		<script src="js/jquery-1.11.2.min.js"></script>
		<!--<script src="js/xbddai.js"></script>-->
		<script src="js/xbddai.js"></script>
		<script src="js/51size.js"></script>
		<script src="js/base.js"></script>
	</head>
	<body>
		<div class="logo">
			<h1 class="logo-in"><a href="index.html">迅泊达-信泊海内、诚达天下</a></h1>
		</div>
		<div class="center">
			<div class="user">
				<div class="login-account">
					<span></span>
					<input type="text" id="username"  placeholder="用户名/手机号"/>
				</div>
				<div class="login-password">
					<span></span>
					<input type="password" id="password"  placeholder="请输入密码"/>
				</div>
			</div>
			<div class="btn">
					<a id="loginBtn" href="javascript:;">登录</a>
			</div>
			<div class="prompt clearfix">
				<span class="option">
					<label for="avoid-landing" onclick="window.location.href='find-password-phone.html'">忘记了密码？</label>
				</span>
				<span class="now-login">
					<a href="register-phone.html">
						<em></em>
						新用户注册
					</a>
				</span>
			</div>
			
		</div>		
	</body>
	<script type="text/javascript">
		$("#loginBtn").click(function(){
			var username=$("#username").val();
			var password=$("#password").val();

			$.ajax({
				type: 'POST',
	        	url:  baseUrl+'/app/login',
	        	async: false,
	        	data:{username:username,password:password},
	        	success: function(result) {
	        		if(result.code==-1){
	        			alert("登录成功!");
						var personal = JSON.stringify({
							uid: result['entity']["uid"],
							login_phone: result['entity']["phone"],
							isnew: result['entity']["isnew"]
						});
						localStorage.setItem("personal", personal);
	        			//window.location.href="account-management.html";
	        			window.location.href="my-account.html";
	        		}else{
	        			alert(result.msg);
	        		}
	        	}
	    	});
		})

	</script>
</html>
